<template>
	<view class="container">
		支付成功
	</view>
</template>

<script>
	import order from '@/api/order.js';
	
	export default{
		onLoad({id}) {
			order.buy(id).then(res=>{
				if(res.code==1){
					let socketMsg = {ClientType:2,Message:"addOrder"}
					this.$store.dispatch('sendWebSocketMessage',JSON.stringify(socketMsg))
					uni.redirectTo({
						url:`/pages/order/detail?id=${id}`
					})
				}
			})
		}
	}
</script>

<style scoped lang="scss">
</style>